package com.dmpp.mes.controller;


import com.dmpp.mes.bean.ResponseData;
import com.dmpp.mes.parameterInfo.Order;
import com.dmpp.mes.parameterInfo.OrderBom;
import com.dmpp.mes.service.OrderBomService;
import com.dmpp.mes.service.OrderService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("OrderBom")
public class OrderBomController {
    //订单BOM管理
    @Autowired
    private OrderBomService service;


    @RequestMapping(value = "/FindAll", method = RequestMethod.POST)
    @ResponseBody
    public ResponseData findAll(Integer page, Integer pageSize, OrderBom orderBom) {
        PageHelper.startPage(page, pageSize);
        return service.findAll(orderBom);
    }

    @RequestMapping(value = "/FindByCode", method = RequestMethod.POST)
    @ResponseBody
    public ResponseData findByCode(OrderBom orderBom) {
        return service.findByCode(orderBom);
    }

    @RequestMapping(value = "/Update", method = RequestMethod.POST)
    @ResponseBody
    public ResponseData update(OrderBom orderBom) {
        return service.update(orderBom);
    }

    @RequestMapping(value = "/Insert", method = RequestMethod.POST)
    @ResponseBody
    public ResponseData insert(OrderBom orderBom) {
        return service.insert(orderBom);
    }

    @RequestMapping(value = "/Delete", method = RequestMethod.POST)
    @ResponseBody
    public ResponseData delete(OrderBom orderBom) {
        return service.delete(orderBom);
    }

}
